a clever number

2021-08-24

Cliff Pickover, @pickover on Twitter, tweeted a clever number: \(105263157894736842\). This has the property that if you multiply it by \(2\), you get the same number except the least significant digit is moved to the front of the number; you get \(210526315789473684\).

twitter.com/pickover/status/1430198127064199174

Naturally, I wanted to see if I could find this, or similar numbers. We're looking for natural numbers \(N\) such that \(2N = (N-2)/10 + 2(10^n)\), where \(n\) is the number of digits needed.

This equation can be rewritten as \(19N = 2(10^{n+1}) - 2\). This immediately gives a necessary condition: \(19\) must divide \(10^{n+1}-1\). I recalled from elementary number theory that, given \(19\) is prime, there must be a natural number \(n\) such that \(19\) does divide \(10^{n+1}-1\).

To find \(n\), I wrote a very small Python program that tried all \(n\) from \(1\) to \(25\). This took advantage of Python's ability to do integer arithmetic with integers of arbitrary precision.

The winning \(n\) turned out to be \(n=17\). This yielded
\[ N = \frac{2(10^{n+1})-2}{19} = \frac{2(10^{17+1})-2}{19} = \frac{2(10^{18})-2}{19} \]
which is in fact Pickover's number:
\[ N = 105263157894736842 \]